# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libusb

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0.19
pkgrel=1
pkgdesc="Library that provides generic access to USB devices'. (mingw-w64)"
arch=('any')
url="http://libusb.info/"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
options=('staticlibs' 'strip')
source=("http://downloads.sourceforge.net/${_realname}/${_realname}-$pkgver.tar.bz2")
md5sums=('f9e2bb5879968467e5ca756cb4e1fa7e')

build() {
  #export lt_cv_deplibs_check_method='pass_all'
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  "${srcdir}"/${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static

  make
}

check() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make check
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
}
